using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_PriceMap : EntityTypeConfiguration<t_Price>
    {
        public t_PriceMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FInterID, t.FItemID, t.FSubTypeID });

            // Properties
            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FSubTypeID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FTag)
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("t_Price");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FSubTypeID).HasColumnName("FSubTypeID");
            this.Property(t => t.FPrice).HasColumnName("FPrice");
            this.Property(t => t.FTag).HasColumnName("FTag");
            this.Property(t => t.FDefault).HasColumnName("FDefault");
        }
    }
}
